<%--
  Created by IntelliJ IDEA.
  User: This
  Date: 2019/7/15
  Time: 8:35
  To change this template use File | Settings | File Templates.
--%>
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<div class="navbar navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container-fluid">
            <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>
            <a class="brand" href="#">管理系统</a>
            <div class="nav-collapse collapse">
                <ul class="nav pull-right">
                    <li class="dropdown">
                        <a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="icon-user"></i>
                            ${loginUser.username}
                            <i class="caret"></i>
                        </a>
                        <ul class="dropdown-menu">
                            <li>
                                <a id="user_info" tabindex="-1" href="javascript:;">个人资料</a>
                            </li>
                            <li class="divider"></li>
                            <li>
                                <a id="logout" tabindex="-1" href="javascript:;">退出</a>
                            </li>
                        </ul>
                    </li>
                </ul>
                <%--头部导航--%>
                <ul id="top_menu" class="nav"><li id="top_index" class="active"><a href="page_index">首页</a></li></ul>
            </div>
            <!--/.nav-collapse -->
        </div>
    </div>
</div>

<script>
    $(function () {
        $("#user_info").click(function () {
            // #code
            layer.msg("用户信息");
        });

        $("#logout").click(function () {
            layer.confirm('您是否要退出？', {
                btn: ['确定', '取消'] //按钮
            }, function () {
                location.href = 'http://' + window.location.host + '${rootPath}/user_logout';
            }, function () {
                return;
            });
        });
    });
</script>
